<template>
  <div id='signup'>
    <h1>注册</h1>
    <v-text-field label="用户名"></v-text-field>
    <v-text-field label="密码" type="password"></v-text-field>
    <v-text-field label="邮箱"></v-text-field>
    <v-btn color="green" dark class="mb-2" @click="regist">注册</v-btn>
    <v-btn @click="login">去登录</v-btn>
  </div>
</template>

<style scoped>
#signup{
  margin:0;
	position: fixed;
	top: calc(50% - 100px);
	left: calc(50% - 100px);
}

</style>
<script>
export default {
  methods: {
    login(){
      this.$router.push("/signUp")
      console.log('==>去登录按钮被点击')
    },
    regist(){
        console.log('==>注册按钮被点击')
        this.$router.push("/registok")
        const timejump = 1;
        if(!this.timer){
            this.count = timejump ;
            this.show = false;
            this.timer = setInterval(()=>{
            if(this.count > 0 && this.count <= timejump ){
                this.count--;
            }else{
                this.show = true;
                clearInterval(this.timer);
                this.timer = null;
                //跳转的页面写在此处
                this.$router.push({path: '/signUp'});
            }
          },2500)
        }
    },
  }
}
</script>